package com.ruoyi.asset.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.asset.mapper.MaintenancePlanMapper;
import com.ruoyi.asset.domain.MaintenancePlan;
import com.ruoyi.asset.service.IMaintenancePlanService;
import com.ruoyi.common.core.text.Convert;

/**
 * 维修保养计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-06
 */
@Service
public class MaintenancePlanServiceImpl extends ServiceImpl<MaintenancePlanMapper,MaintenancePlan> implements IMaintenancePlanService
{
    @Autowired
    private MaintenancePlanMapper maintenancePlanMapper;

    /**
     * 查询维修保养计划
     * 
     * @param id 维修保养计划主键
     * @return 维修保养计划
     */
    @Override
    public MaintenancePlan selectMaintenancePlanById(String id)
    {
        return maintenancePlanMapper.selectMaintenancePlanById(id);
    }

    /**
     * 查询维修保养计划列表
     * 
     * @param maintenancePlan 维修保养计划
     * @return 维修保养计划
     */
    @Override
    public List<MaintenancePlan> selectMaintenancePlanList(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.selectMaintenancePlanList(maintenancePlan);
    }

    /**
     * 新增维修保养计划
     * 
     * @param maintenancePlan 维修保养计划
     * @return 结果
     */
    @Override
    public int insertMaintenancePlan(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.insertMaintenancePlan(maintenancePlan);
    }

    /**
     * 修改维修保养计划
     * 
     * @param maintenancePlan 维修保养计划
     * @return 结果
     */
    @Override
    public int updateMaintenancePlan(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.updateMaintenancePlan(maintenancePlan);
    }

    /**
     * 批量删除维修保养计划
     * 
     * @param ids 需要删除的维修保养计划主键
     * @return 结果
     */
    @Override
    public int deleteMaintenancePlanByIds(String ids)
    {
        return maintenancePlanMapper.deleteMaintenancePlanByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除维修保养计划信息
     * 
     * @param id 维修保养计划主键
     * @return 结果
     */
    @Override
    public int deleteMaintenancePlanById(String id)
    {
        return maintenancePlanMapper.deleteMaintenancePlanById(id);
    }
}
